#!/usr/bin/python
# -*- coding:utf-8 -*-

from .. import Util

class SearchEngine:
    def Search(self):
        raise NotImplementedError()

class SearchResult:
    def __init__(self,title,description,url,time):
        self.Title=unicode(title,"utf-8")
        self.Description=unicode(description,"utf-8")
        self.URL=url
        self.Time=time

    def __str__(self):
        return "[title=%s\ndescription=%s\nURL=%s]\n" % (Util.JapaneseConsole(self.Title),Util.JapaneseConsole(self.Description),self.URL)
    
    

class SearchResultCollection(list):
    def __init__(self,totalCount=None):
        if not totalCount is None:
            self.TotalCount=totalCount